﻿//===================================================================================
// Copyright (c) Ryan Garrett.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===================================================================================

namespace Caffeine.Core.Test
{
    public static class Creator
    {
        #region Constructors

        static Creator()
        {
            ModelFactory = new ModelFactory();
        }

        #endregion

        #region Public

        public static IModelFactory ModelFactory
        {
            get;
            set;
        }

        public static T Create<T>() where T : ModelBase, new()
        {
            return Create<T>(ModelFactory);
        }

        public static T Create<T>(IModelFactory factory) where T : ModelBase, new()
        {
            return factory.CreateModel<T>();
        }

        #endregion
    }
}
